

	function closeBox() {
	parent.tb_remove();
	}

	
function addEmailAddrsInfo(){

	var listsize = self.document.getElementById('listsize').value;
	var pkid_string = parent.document.getElementById('email').value ;
	var numz = 0;
	for(var i=0;i<listsize;i++){
		if(self.document.getElementById('checkone'+i).checked){
			if(pkid_string.indexOf(self.document.getElementById('checkone'+i).value+'|') < 0){
				pkid_string += self.document.getElementById('checkone'+i).value+'|';
				++numz;
			}
		}
	}

		self.document.getElementById('all_target_id').value = pkid_string;
		parent.document.getElementById('email').value = pkid_string;
			alert("您已添加"+numz+"个邮箱地址");
	
}

function removeEmailAddrsInfo(){

	var listsize = self.document.getElementById('listsize').value;
	var pkid_string = parent.document.getElementById('email').value;
	var numz = 0;
	for(var i=0;i<listsize;i++){
		if(self.document.getElementById('checkone'+i).checked){
			if(pkid_string.indexOf(self.document.getElementById('checkone'+i).value+'|') >= 0){
				var tem_id =  self.document.getElementById('checkone'+i).value;
				pkid_string = pkid_string.replace(tem_id+"|","");
				++numz;
			}
		}
	}
	
	parent.document.getElementById('email').value = pkid_string;
	self.document.getElementById('all_target_id').value = pkid_string ;
	alert("您已删除"+numz+"个邮箱地址");
	
}
	
	function addEmailAddrs(val) {
	var emailaddr = val.substr(1)
	emailaddrs += emailaddr.trim() + "|";
	}
	
	function removeEmailAddr(val){
	var emailaddr = val.substr(1)
	var regStr =emailaddr.trim()+"|";
	emailaddrs = emailaddrs.replace(regStr,"");
	}
	